<html>
	<head>
		<script type="text/javascript" charset="utf-8">
			function onClick(info, tab){
				var word;
				if (!info.selectionText)return;
				word = info.selectionText;
				chrome.tabs.create(
					{"url": "http://translate.google.com/#auto|zh-CN|"+word, 
					"selected": true,
					"index": tab.index
				}
				);
			}
			chrome.contextMenus.create(
			{	"title":"Translate", 
				"contexts": ["selection"],
				"onclick": onClick
			}
			);//edited online, how it works?
		</script>
	</head>
	<body></body>
</html>